import { submitFromData } from '../../common/js/mixin'

let component = {
  properties: {
    goodsList: {
      type: Array,
      value: []
    },
    classId: {
      type: Object,
      value: {}
    }
  },
  ready () {
    // console.log(this.properties.goodsList)
    var query = wx.createSelectorQuery()
    query.select('.goods-wrap').boundingClientRect(function (rect) {
    }).exec()
  },
  methods: {
    toGoodDetail (e) {
      this._submitFrom(e.detail.formId)
      this.triggerEvent('goToDetail', e.currentTarget.dataset.id)
    },
    toGoodsClass (e) {
      this.triggerEvent('toGoodsClass', e.currentTarget.dataset)
    }
  }
}
submitFromData(component)
Component(component)
